import request from '@/api/http.js'

//获取产品检验单
export const getProductInspectionOrderList = (params) => {
    console.log('changeWorkStatus发送参数:', params)
    const query = new URLSearchParams(params).toString();
    return request.get(`api/ProductInspectionOrder/GetProductInspectionOrderList?${query}`)
}

// 新增产品检验单
export const addProductInspectionOrder = (params) => {
    return request.post('api/ProductInspectionOrder/AddProductInspectionOrder',params)
}

// 编辑产品检验单
export const updateProductInspectionOrder = (params) => {
    return request.post('api/ProductInspectionOrder/UpdateProductInspectionOrder',params)
}

// 修改产品检验单状态
export const updateProductInspectionOrderStatus = (params) => {
    return request.post(`api/ProductInspectionOrder/UpdateProductInspectionOrderStatus`,params)
}

// 获取生产计划列表
export const getProductPlanList = (params) => {
    console.log('changeWorkStatus发送参数:', params)
    const query = new URLSearchParams(params).toString();
    return request.get(`api/Production_ProductPlan/getPageDataInfo?${query}`)
}

// 获取生产计划数据详情
export const getProductInspectionInfo = (id) => {
    return request.get(`/api/ProductInspectionOrder/GetProductInspectionInfo?id=${id}`)
}

// 返工
export const productInspectionOrderRework = (params) => {
    return request.post(`api/ProductInspectionOrder/ProductInspectionOrderRework`,params)
}

// 报废
export const productInspectionOrderScrap = (params) => {
    return request.post(`api/ProductInspectionOrder/ProductInspectionOrderScrap`,params)
}